﻿using System;
using System.Collections.Generic;

namespace Pap.Data
{
    /// <summary>
    /// 
    /// </summary>
    public interface IMembershipRepository : IRepository
    {
        #region [ Users ]

        /// <summary>
        /// Gets the user by ID.
        /// </summary>
        /// <param name="userID">The user ID.</param>
        /// <returns></returns>
        IUser GetUserByID(Guid userID);

        /// <summary>
        /// Finds the users.
        /// </summary>
        /// <param name="Where">The where.</param>
        /// <returns></returns>
        IEnumerable<IUser> FindUsers(System.Linq.Expressions.Expression<Func<IUser, bool>> Where);

        /// <summary>
        /// Creates the user.
        /// </summary>
        /// <param name="User">The user.</param>
        void CreateUser(IUser User);

        /// <summary>
        /// Deletes the users.
        /// </summary>
        /// <param name="Where">The where.</param>
        void DeleteUsers(System.Linq.Expressions.Expression<Func<IUser, bool>> Where);

        /// <summary>
        /// Deletes the user roles.
        /// </summary>
        /// <param name="user">The user.</param>
        void DeleteUserRoles(IUser user);

        /// <summary>
        /// Deletes the user committees.
        /// </summary>
        /// <param name="user">The user.</param>
        void DeleteUserCommittees(IUser user);

        IEnumerable<IUser> FindUsersByPermission(Permissions permission);
        #endregion

        #region [ Roles ]

        /// <summary>
        /// Gets the role by ID.
        /// </summary>
        /// <param name="roleID">The role ID.</param>
        /// <returns></returns>
        IRole GetRoleByID(Guid roleID);

        /// <summary>
        /// Finds the roles.
        /// </summary>
        /// <param name="Where">The where.</param>
        /// <returns></returns>
        IEnumerable<IRole> FindRoles(System.Linq.Expressions.Expression<Func<IRole, bool>> Where);

        /// <summary>
        /// Creates the role.
        /// </summary>
        /// <param name="Role">The role.</param>
        void CreateRole(IRole Role);

        /// <summary>
        /// Deletes the roles.
        /// </summary>
        /// <param name="Where">The where.</param>
        void DeleteRoles(System.Linq.Expressions.Expression<Func<IRole, bool>> Where);

        /// <summary>
        /// Deletes the role permissions.
        /// </summary>
        /// <param name="role">The role.</param>
        void DeleteRolePermissions(IRole role);

        #endregion

        #region [ Permissions ]

        /// <summary>
        /// Gets all permissions.
        /// </summary>
        /// <returns></returns>
        IEnumerable<IPermission> GetAllPermissions();

        #endregion


        #region [ Board Members ]

        /// <summary>
        /// Gets the member by ID.
        /// </summary>
        /// <param name="memberID">The member ID.</param>
        /// <returns></returns>
        IBoardMember GetMemberByID(Guid memberID);

        /// <summary>
        /// Finds the members.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<IBoardMember> FindMembers(System.Linq.Expressions.Expression<Func<IBoardMember, bool>> where);
        #endregion

        
    }
}
